sysctl: make XEN_SYSCTL_numainfo a little more efficient
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Tue, 21 Apr 2015 07:06:00 +0000 (09:06 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 21 Apr 2015 07:06:00 +0000 (09:06 +0200)
commitd2c9475378967cb93901f65a7e7447106ee1a08a
tree629ad1a3bad6ae092404364f2a070afbcddf78ab
parent176d24bcb2e7e43ca9e1178b06f81b49fdbb9142
sysctl: make XEN_SYSCTL_numainfo a little more efficient

A number of changes to XEN_SYSCTL_numainfo interface:

* Make sysctl NUMA topology query use fewer copies by combining some
  fields into a single structure and copying distances for each node
  in a single copy.
* NULL meminfo and distance handles are a request for maximum number
  of nodes (num_nodes). If those handles are valid and num_nodes is
  is smaller than the number of nodes in the system then -ENOBUFS is
  returned (and correct num_nodes is provided)
* Instead of using max_node_index for passing number of nodes keep this
  value in num_nodes: almost all uses of max_node_index required adding
  or subtracting one to eventually get to number of nodes anyway.
* Replace INVALID_NUMAINFO_ID with XEN_INVALID_MEM_SZ and add
  XEN_INVALID_NODE_DIST.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/libxl/libxl.c
tools/python/xen/lowlevel/xc/xc.c
xen/common/sysctl.c
xen/include/public/sysctl.h